////////////////////////////////////////////////////////////////
// filename: list.h
// description: header file for the double linked list class
// author: Jay Tomten (jaytomten@gmail.com)
// notes:

// namespace
using namespace std;

// defines
#ifndef __LIST__
#define __LIST__

// includes
#include "object.h"

// globals

////////////////////////////////////////////////////////////////
// Node - the super simple node class class
class Node
    {

    public:

        Object *o;  //value stored in the node
        Node *next; //pointer to next node
        Node *prev; //pointer to previous node

        ////////////////////////////////////////////////////////////
        // destructor
        ~Node()
            {

            delete o;
            delete next;
            delete prev;

            }

    };

////////////////////////////////////////////////////////////////
// List - definition of our doubely linked list
class List
    {

    public:

        Node *front; //pointer to front of list
        Node *back;  //pointer to back of list

        List();  // constructor
        ~List(); // destructor

        void InsertFront(Object *a);           // insert a node at the front of the list
        void InsertBack(Object *a);            // insert a node at the back of the list
        void InsertBefore(Object *a, Node *n); // insert a node befor another one
        void InsertAfter(Object *a, Node *n);  // insert a node after another one
        void Remove(Node *n);                  // remove a dead node

    private:

    };

#endif
